package com.nfIt;

import com.nfIt.service.Bookservice;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * ClossName:APP01
 * Pakage:com.nfIt
 * Description
 *
 * @Author L
 * @Create 2024/4/23 20:01
 * @Version 2023.1.3
 */
public class APP01 {
    public static void main(String[] args) {

        ClassPathXmlApplicationContext atc = new ClassPathXmlApplicationContext("applicationContext.xml");

        Bookservice bookService = (Bookservice) atc.getBean("service");

        bookService.say();
        //ClassPathXmlApplicationContext ：有close()方法
        //applicationContext ：没有close()方法
        atc.registerShutdownHook();
    }
}
